package gui.visu.listeners;

import gui.visu.dialogs.JDialogAddDisplayDataCompare;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import controls.DataControl;


/**
 * @author Charles Perin
 * 29 mars 2011
 * LIMSI - INRIA Rennes
 * charles.perin@free.fr
 *
 */
public class ListenerAddDisplayDataCompareButton implements ActionListener{

	private DataControl dataControl;

	public ListenerAddDisplayDataCompareButton(DataControl dataControl){
		setDataControl(dataControl);
	}

	@Override
	public void actionPerformed(ActionEvent arg0) {
		JDialogAddDisplayDataCompare dial = new JDialogAddDisplayDataCompare("Compare two display data", false, dataControl);
		dial.setLocationRelativeTo(dataControl.getIhm());
		dial.setVisible(true);
		dataControl.getIhm().setEnabled(false);
	}

	public DataControl getDataControl() {
		return dataControl;
	}

	public void setDataControl(DataControl dataControl) {
		this.dataControl = dataControl;
	}
}
